@import '../../styles/var.less';

.k-popconfirm {
  display: inline-block;
  // position: relative;
  min-width: 200px;
  // max-width: 300px;
  font-size: 12px;
  line-height: 1.5;
  position: absolute;
  z-index: 1001;
  color: var(--kui-color-font);

  &[k-placement^=top] {
    .k-popconfirm-arrow {
      bottom: -7px;
      height: 9px;
    }

    .k-popconfirm-content {
      margin-bottom: 12px;
    }
  }

  &[k-placement=top] {
    .k-popconfirm-arrow {
      left: 50%;
      transform: translateX(-50%);
    }
  }

  &[k-placement=top-right] {
    .k-popconfirm-arrow {
      right: 10px;
    }
  }

  &[k-placement=top-left] {
    .k-popconfirm-arrow {
      left: 10px;
    }
  }

  &[k-placement^=bottom] {
    .k-popconfirm-arrow {
      top: -7px;
      height: 9px;
      transform: rotate(180deg);
    }

    .k-popconfirm-content {
      margin-top: 12px;
    }
  }

  &[k-placement=bottom] {
    .k-popconfirm-arrow {
      left: 50%;
    }
  }

  &[k-placement=bottom-left] {
    .k-popconfirm-arrow {
      left: 10px;
    }
  }

  &[k-placement=bottom-right] {
    .k-popconfirm-arrow {
      right: 10px;
    }
  }

  &[k-placement^=left] {
    .k-popconfirm-arrow {
      right: -14px;
      width: 23px;
      height: 9px;
      transform: rotate(-90deg);
    }

    .k-popconfirm-content {
      margin-right: 12px;
    }
  }

  &[k-placement=left] {
    .k-popconfirm-arrow {
      top: 50%;
      transform: translateY(-50%) rotate(-90deg);
    }
  }

  &[k-placement=left-bottom] {
    .k-popconfirm-arrow {
      bottom: 17px;
    }
  }

  &[k-placement=left-top] {
    .k-popconfirm-arrow {
      top: 17px;
    }
  }

  &[k-placement^=right] {
    .k-popconfirm-arrow {
      left: -14px;
      width: 23px;
      height: 9px;
      transform: rotate(90deg);
    }

    .k-popconfirm-content {
      margin-left: 12px;
    }
  }

  &[k-placement=right] {
    .k-popconfirm-arrow {
      top: 50%;
      transform: translateY(-50%) rotate(90deg);
    }
  }

  &[k-placement=right-top] {
    .k-popconfirm-arrow {
      top: 17px;
    }
  }

  &[k-placement=right-bottom] {
    .k-popconfirm-arrow {
      bottom: 17px;
    }
  }
}

.k-popconfirm-content {
  // .k-popconfirm-inner {
  background: var(--kui-color-control-10);
  // background: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-radius: 12px; //var(--kui-border-radius);
  position: relative;
  // border: 1px solid var(--kui-color-border);
  // }
  border: 1px solid var(--kui-color-border);

  #ot {
    stroke-width: 0.1em;
    stroke: var(--kui-color-border);
  }

  .k-popconfirm-body {
    padding: 18px 18px 10px 18px;
    box-sizing: border-box;
    position: relative;
  }

  .k-icon {
    position: absolute;
    font-size: 18px;
    color: var(--kui-color-warning);
    top: 19px;
  }

  .k-popconfirm-footer {
    text-align: right;
    padding-top: 10px;
  }

  .k-popconfirm-title {
    padding: 0 0 0 24px;
    font-size: 14px;
  }

  .k-popconfirm-arrow {
    position: absolute;
    box-sizing: border-box;
    display: flex;
    color: var(--kui-color-control-10);
    // color:inherit;
    width: 23px;
    height: 9px;
  }

  .k-popconfirm-footer {
    text-align: right;
    padding: 8px 16px 16px;

    .k-btn {
      margin-left: 10px;
    }
  }
}

@keyframes k-pop-zoom {
  from {
    opacity: 0;
    transform: scale(.8, .8);
  }

  to {
    opacity: 1;
    transform: scale(1, 1);
  }
}


.k-popconfirm-enter-active {
  // transform-origin: center bottom;
  animation: k-pop-zoom .3s;
}

.k-popconfirm-leave-active {
  // transform-origin: center bottom;
  animation: k-pop-zoom .3s reverse;
}